package com.yida.gwj.expend.service.impl;

import com.yida.common.core.utils.DateUtils;
import com.yida.gwj.expend.domain.GwjMaintenanceFundsBusinessHouse;
import com.yida.gwj.expend.domain.dto.AllocatedAmountListDTO;
import com.yida.gwj.expend.domain.request.AllocatedAmountRequest;
import com.yida.gwj.expend.mapper.GwjMaintenanceFundsBusinessHouseMapper;
import com.yida.gwj.expend.service.IGwjMaintenanceFundsBusinessHouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务房屋信息Service业务层处理
 *
 * @author lgp
 * @date 2023-02-20
 */
@Service
public class GwjMaintenanceFundsBusinessHouseServiceImpl implements IGwjMaintenanceFundsBusinessHouseService {
    @Autowired
    private GwjMaintenanceFundsBusinessHouseMapper gwjMaintenanceFundsBusinessHouseMapper;

    /**
     * 查询业务房屋信息
     *
     * @param businessHouseId 业务房屋信息主键
     * @return 业务房屋信息
     */
    @Override
    public GwjMaintenanceFundsBusinessHouse selectGwjMaintenanceFundsBusinessHouseByBusinessHouseId(Long businessHouseId) {
        return gwjMaintenanceFundsBusinessHouseMapper.selectGwjMaintenanceFundsBusinessHouseByBusinessHouseId(businessHouseId);
    }

    /**
     * 查询业务房屋信息列表
     *
     * @param gwjMaintenanceFundsBusinessHouse 业务房屋信息
     * @return 业务房屋信息
     */
    @Override
    public List<GwjMaintenanceFundsBusinessHouse> selectGwjMaintenanceFundsBusinessHouseList(GwjMaintenanceFundsBusinessHouse gwjMaintenanceFundsBusinessHouse) {
        return gwjMaintenanceFundsBusinessHouseMapper.selectGwjMaintenanceFundsBusinessHouseList(gwjMaintenanceFundsBusinessHouse);
    }

    /**
     * 新增业务房屋信息
     *
     * @param gwjMaintenanceFundsBusinessHouse 业务房屋信息
     * @return 结果
     */
    @Override
    public int insertGwjMaintenanceFundsBusinessHouse(GwjMaintenanceFundsBusinessHouse gwjMaintenanceFundsBusinessHouse) {
        gwjMaintenanceFundsBusinessHouse.setCreateTime(DateUtils.getNowDate());
        return gwjMaintenanceFundsBusinessHouseMapper.insertGwjMaintenanceFundsBusinessHouse(gwjMaintenanceFundsBusinessHouse);
    }

    /**
     * 修改业务房屋信息
     *
     * @param gwjMaintenanceFundsBusinessHouse 业务房屋信息
     * @return 结果
     */
    @Override
    public int updateGwjMaintenanceFundsBusinessHouse(GwjMaintenanceFundsBusinessHouse gwjMaintenanceFundsBusinessHouse) {
        gwjMaintenanceFundsBusinessHouse.setUpdateTime(DateUtils.getNowDate());
        return gwjMaintenanceFundsBusinessHouseMapper.updateGwjMaintenanceFundsBusinessHouse(gwjMaintenanceFundsBusinessHouse);
    }

    /**
     * 删除业务房屋信息信息
     *
     * @param businessHouseId 业务房屋信息主键
     * @return 结果
     */
    @Override
    public int deleteGwjMaintenanceFundsBusinessHouseByBusinessHouseId(Long businessHouseId) {
        return gwjMaintenanceFundsBusinessHouseMapper.deleteGwjMaintenanceFundsBusinessHouseByBusinessHouseId(businessHouseId);
    }

    @Override
    public int deleteGwjMaintenanceFundsBusinessHouseByBusinessId(Long businessId) {
        return gwjMaintenanceFundsBusinessHouseMapper.deleteGwjMaintenanceFundsBusinessHouseByBusinessId(businessId);
    }

    @Override
    public GwjMaintenanceFundsBusinessHouse selectGwjMaintenanceFundsBusinessHouseByBusinessId(Long businessId) {
        return gwjMaintenanceFundsBusinessHouseMapper.selectGwjMaintenanceFundsBusinessHouseByBusinessId(businessId);
    }

    @Override
    public int insertBatchGwjMaintenanceFundsBusinessHouse(List<GwjMaintenanceFundsBusinessHouse> maintenanceFundsBusinessHouseList) {
        return gwjMaintenanceFundsBusinessHouseMapper.insertBatchGwjMaintenanceFundsBusinessHouse(maintenanceFundsBusinessHouseList);
    }

    @Override
    public List<AllocatedAmountListDTO> allocatedAmountList(AllocatedAmountRequest allocatedAmountRequest) {
        return gwjMaintenanceFundsBusinessHouseMapper.allocatedAmountList(allocatedAmountRequest);
    }

    /**
     * 查询未选中房屋
     *
     * @param allocatedAmountRequest 业务房屋信息
     * @return 业务房屋信息集合
     */
    @Override
    public List<GwjMaintenanceFundsBusinessHouse> selectCancelHouseList(AllocatedAmountRequest allocatedAmountRequest) {
        return gwjMaintenanceFundsBusinessHouseMapper.selectCancelHouseList(allocatedAmountRequest);
    }

    /**
     * 查询房屋用途列表
     *
     * @return {@link List}<{@link String}>
     */
    @Override
    public List<String> selectUseTypeList() {
        return gwjMaintenanceFundsBusinessHouseMapper.selectUseTypeList();
    }
}
